package com.stu.Controller;

import com.stu.Pojo.Login;
import com.stu.service.EmployeeService;
import com.stu.util.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LoginCroller
{
    //注入  employee
    @Autowired
    private EmployeeService  employeeService;
    @PostMapping("/login")
    public AjaxResult   checkPassword(@RequestBody Login login)
    {
     String  Result=   employeeService.checkPassword(login);
      if(Result.equals("密码正确")){
          return  new AjaxResult(true,"操作成功");
      }else {
          return   new AjaxResult(false,"失败");
      }
    }
}
